Poly-Controlled Partial Evaluation and its Application to Resource-Aware Program Specialization PhD Thesis
نویسندگان
چکیده
Partial Evaluation is an automatic technique for program optimization. The aim of partial evaluation is to specialize a program with respect to part of its input, which is known as the static data. Existing algorithms for on-line partial evaluation of logic programs, given an initial program and a description of runtime queries, deterministically produce a specialized program. The quality of the code generated by partial evaluation of logic programs greatly depends on the control strategy used. Unfortunately, the existence of sophisticated control rules which behave (almost) optimally for all programs is still far from reality. The main contribution of this thesis is the development of Poly-Controlled Partial Evaluation, a novel framework for partial evaluation which is polycontrolled in that it can take into account repertoires of control strategies instead of a single, predetermined combination (as done by traditional partial evaluation). This approach is more flexible than existing ones since it allows assigning different control strategies to different call patterns, thus generating results that cannot be obtained using traditional partial evaluation. As a result, sets of candidate specialized programs can be generated, instead of a single one. In order to make the algorithm fully automatic, it requires the use of self-tuning techniques which allow automatically measuring the quality of the different candidate specialized programs. Our approach is resource aware in that every solution obtained by poly-controlled partial evaluation is assessed by means of fitness functions, which can consider multiple factors such as run-time and code size for the specialized programs. The framework has been implemented in the CiaoPP system, and tested on numerous benchmarks. Experimental results show that our proposal obtains better specializations than those achieved using traditional partial evaluation, especially in the context of resource-aware program specialization. Another main contribution of this thesis is the presentation of a unifying view
منابع مشابه
C Program Specialization Master ’ s
Automatic program specialization has numerous application areas ranging from specialization of scientific computation to automatic compiler generation. During the last decade, several automatic partial evaluators have been developed and demonstrated their usefulness. However, none of these have both been for a typed imperative language and self-applicable. The main content of this thesis is the...
متن کاملOracle-Based Partial Evaluation
We present Oracle-Based Partial Evaluation (OBPE), a novel approach to on-line Partial Evaluation (PE) which decides the control strategy to use for each call pattern by using an oracle function which compares the results of specializing such call pattern w.r.t. a set of strategies. Our proposal is motivated by Poly-Controlled Partial Evaluation (PCPE), which allows using different control stra...
متن کاملImplementing Memoization for Partial Evaluation
Memoization is a key ingredient in every partial evaluator. It enables folding by caching previously specialized functions. It is essential to make polyvariant specialization terminate. Its implementation is reasonably straightforward in a standard specializer that represents functions by closures. With the advent of handwritten program-generator generators (PGGs), implementing memoization gets...
متن کاملProgram Analysis and Specialization for the C Programming Language Ph.D. Thesis
Software engineers are faced with a dilemma. They want to write general and wellstructured programs that are flexible and easy to maintain. On the other hand, generality has a price: efficiency. A specialized program solving a particular problem is often significantly faster than a general program. However, the development of specialized software is time-consuming, and is likely to exceed the p...
متن کاملA Unified Framework for Partial Evaluation and Program Slicing
The emphasis on code re-usability in component-based software development has resulted in degradation of system performance. Component specialization techniques have been proposed to overcome this problem. They mainly specialize components wrt contents of component interfaces. This requires specialization to be performed in either a forward or backward direction. The current state of the art ap...
متن کامل